import { get, getRestful, getByHeaders, post, put, del } from '@/util/request'
const API_PATH = "/inner_api/front/blog"

/**
 * 查询博客数据
 * 
 * @param {*} pageNum 页码
 * @returns 
 */
export function selectListByPage (queryInfo) {
  return post(API_PATH + '/selectListByPage', queryInfo)
}

/**
 * 搜索博客
 * 
 * @param {*} data 
 * @returns 
 */
export function searchBlog (data) {
  return post(API_PATH + '/searchBlog', data)
}

/**
 * 根据id获取博客数据
 * 
 * @param {*} token 博客密码生成的token
 * @param {*} id 
 * @returns 
 */
export function getBlogById (id, token) {
  const data = {
    id: id,
    token: token,
  }
  return post(API_PATH + '/getBlogById', data)
}

/**
 * 根据id查询数据
 * 
 * @param {*} id 
 * @returns 
 */
export function findById (id) {
  return getRestful(API_PATH + '/findById', id)
}

/**
 * 校验密码
 * 
 * @param {*} data
 * @return {*}
 * @description: 
 * @author: WangJin
 * @date: 2023-07-03 16:33:41
 */
export function checkBlogPassword (data) {
  return post(API_PATH + '/checkBlogPassword', data)
}

/**
 * 校验密码正确性
 * 
 * @param {*} data
 * @return {Boolean}
 * @description: 
 * @author: WangJin
 * @date: 2023-07-08 17:38:54
 */
export function validateBlogPasswordCorrect (data) {
  return post(API_PATH + '/validateBlogPasswordCorrect', data)
}




